.\" Process this file with
.\" groff -man -Tascii foo.1
.\"
.TH TERMIT 30 "NOV 2008" Linux "User Manuals"
.SH NAME
termit \- lightweight terminal emulator

.SH SYNOPSIS
.B termit [-option ...]

.SH DESCRIPTION
.B termit
is a vte-based lightweight terminal emulator. All configuration
is done via Lua-scripts. The only other dependencies are 
Gtk+ and Vte.

.SH OPTIONS
.BR -h
or
.BR --help
.RS
Print help
.RE
.BR -v
or
.BR --version
.RS
Print version number
.RE
.BR -e
or
.BR --execute
.I cmd
.RS
Use
.I cmd
as shell
.P
termit --execute=zsh
.P
.RE
.BR -i
or
.BR --init
.I file
.RS
Use
.I file
instead of default init.lua
.P
termit --init=session.lua
.P
.RE
.SH FILES
.I $HOME/.config/termit/init.lua
.RS
Per user configuration file. See section
.BR "TERMIT LUA API"
for further details.
.RE
.I /usr/share/doc/termit/init.lua.example
.RS
Example init.lua file. Demonstrates usage of almost all available settings.
.SH "TERMIT LUA API"
.B setOptions
(
.I opts
)
Changes default options.
.RS
opts - table with new options:
    tabName - default tab name
    encoding - default encoding
    wordChars - word characters (double click selects word)
    font - font name
    foregroundColor
    backgroundColor
    showScrollbar
    fillTabbar - expand tabs' titles to fill whole tabbar
    allowChangingTitle - auto change title (similar to xterm)
    audibleBell - enables audible bell
    visibleBell - enables visible bell
    getWindowTitle - lua function to generate new window title
    getTabTitle - lua function to generate new tab title
    transparentBackground - use transparency
    transparentSaturation - level of saturation [0,1]
    hideSingleTab
    hideMenubar
    scrollbackLines
    geometry - cols x rows to start with
.RE
.P
.B setColormap
(
.I colors
)
Sets colors for tabs (8, 16 and 24 colors supported).
.RE
.P
.B bindKey
(
.I keys
,
.I luaFunction
)
Sets new keybinding. If luaFunction is 
.I nil
removes keybinding.
.RS
keys - string with keybinding
.RE
.RS
luaFunction - callback function
.RE
.P
.B bindMouse
(
.I event
,
.I luaFunction
)
Sets new mouse-binding. If luaFunction is 
.I nil
removes mouse-binding.
.RS
event - string with one of those values:
    DoubleClick
.RE
.RS
luaFunction - callback function
.RE
.P
.B setKbPolicy
(
.I kb_policy
)
Sets keyuboard policy for shortcuts.
.RS
kb_policy - string with one of those values:
    keycode - use hardware keyboard codes (XkbLayout-independent)
    keysym - use keysym values (XkbLayout-dependent)
.RE
.P
.B currentTabIndex
()
Returns current tab index.
.RE
.P
.B openTab
(
.I tabInfo
)
Opens new tab.
.RS
tabinfo - table with tab settings:
    name - tab name
    command - command to run as "shell"
    encoding
    working_dir
.RE
.P
.B prevTab
()
Activates previous tab.
.P
.B nextTab
()
Activates next tab.
.P
.B closeTab
()
Closes active tab.
.P
.B activateTab
(
.I tab_index
)
Activates tab by index.
.RS
tab_index - index of tab to activate. Index of the first tab is 1.
.RE
.P
.B copy
()
Copies selection into tab's buffer.
.P
.B paste
()
Pastes tab's buffer.
.P
.B addMenu
(
.I menu
)
Adds menu in menubar.
.RS
menu - table with nested menuitems
    menuitem - also table
        name - name for menuitem
        action - string in lua to perform when item activated
.RE
.P
.B addPopupMenu
( .I menu
)
Adds menu in popup menu, similar to addMenu.
.P
.B setEncoding
(
.I encoding
)
Changes encoding for active tab.
.RS
encoding - string with encoding name.
.RE
.P
.B setTabTitle
(
.I tabTitle
)
Changes title for active tab.
.RS
tabTitle - string with new tab title.
.RE
.P
.B setWindowTitle
(
.I title
)
Changes termit window title.
.RS
title - string with new title.
.RE
.P
.B setTabForegroundColor
(
.I color
)
Changes foreground (e.g. font) color for active tab.
.RS
color - string with new color.
.RE
.P
.B setTabBackgroundColor
(
.I color
)
Changes background color for active tab.
.RS
color - string with new color.
.RE
.P
.B spawn
(
.I command
)
Spawns command (works via shell).
.RS
command - string with command and arguments.
.RE
.P
.B reconfigure
()
Sets all configurable variables to defaults and forces rereading init.lua.
.SH BUGS
After start sometimes there is black screen. Resizing termit window helps.
.SH AUTHOR
Evgeny Ratnikov <ratnikov.ev at gmail dot com>
.SH "SEE ALSO"
.BR lua (1)
